$(document).ready(function () {
    $.ajax({
        type:'GET',
        url:"/jowey/player/getPlayersInProject",
        dataType:'json',
        success:function (result) {
        	
        	var table = $('#timeReportOpenTable');
        	var line;
        	var tdRegistration;
        	var tdName;
        	var tdEmail;
        	var tdLinkOpen;
        	var linkOpen;
        	
        	for(var i = 0;i<result.length;i++){
  
        		line		   = document.createElement("tr");
        		tdRegistration = document.createElement("td");
        		tdName 	       = document.createElement("td");
        		tdEmail 	   = document.createElement("td");
            	tdLinkOpen     = document.createElement("td");
            	
            	tdRegistration.innerHTML  = result[i].registration;
            	tdName.innerHTML		  = result[i].name;
            	tdEmail.innerHTML		  = result[i].email;
            	linkOpen				  = "../timeReport/playerReportOpen/"+result[i].registration;
            	
            	tdLinkOpen.innerHTML      = "<a href="+linkOpen+">OPEN</a>";
            	
            	line.appendChild(tdRegistration);
            	line.appendChild(tdName);
            	line.appendChild(tdEmail);
            	line.appendChild(tdLinkOpen);
            	
            	table.append(line);
        	}
        },
        error:function (jqXHR, textStatus, errorThrown) {
            alert("player " + textStatus + " " + errorThrown + " !");
        }
    });
});

